﻿using System;
using System.Globalization;

namespace NeuralStock.Entities
{    
    public class MacroDataBankierData : MacroDataData
    {
        public override object ParseLine(string line)
        {
            var lineAfterSplit = line.Split(',');

            var returnData = new MacroDataBankierData();
            
            DateTime date;
            if (DateTime.TryParse(lineAfterSplit[0], out date))
            {
                returnData.Year = date.Year;
                returnData.Month = date.Month;
                returnData.Value = decimal.Parse(lineAfterSplit[1], CultureInfo.InvariantCulture);
            }

            return returnData;
        }
    }
}
